package com.py.credit.dao;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.py.framework.core.common.Page;

/**
 * 信用评价前台网站信用申报Dao
 */
public interface GatewayDeclarationInformationDao {

	/**
	 * 查询申报管理中指标相关联的表
	 *
	 * @return
	 */
	String selectRelateSourceId(@Param(value = "rootId") int rootId);

	/**
	 * 查询申报表
	 *
	 * @param ids
	 * @return
	 */
	List<LinkedHashMap> selectTableList(@Param(value = "ids") List<String> ids);

	/**
	 * 查询申报表有多少条数据
	 *
	 * @param tableName
	 * @return
	 */
	int selectTableValueCount(@Param(value = "tybm") String tybm, @Param(value = "tableName") String tableName);

	/**
	 * 获取申报表字段
	 *
	 * @param tableName
	 * @return
	 */
	List<LinkedHashMap> selectTableFiledList(@Param(value = "tableName") String tableName);

	/**
	 * 获取申报表表头
	 *
	 * @param tableName
	 * @return
	 */
	List<LinkedHashMap> selectTableTitleList(@Param(value = "tableName") String tableName);

	/**
	 * 查询申报列表
	 *
	 * @param tableName
	 * @return
	 */
	List<LinkedHashMap> selectDeclarationInformationListForPage(@Param(value = "tybm") String tybm,
			@Param(value = "field") String field, @Param(value = "tableName") String tableName,
			@Param(value = "page") Page page);

	/**
	 * 查询申报详情
	 *
	 * @param field
	 * @param tableName
	 * @param id
	 * @return
	 */
	LinkedHashMap selectDeclarationInformationInfo(@Param(value = "field") String field,
			@Param(value = "tableName") String tableName, @Param(value = "id") String id);

	/**
	 * 查询申报表字段sql
	 *
	 * @param tableName
	 * @return
	 */
	String selectTableFieldSql(@Param(value = "tableName") String tableName);

	/**
	 * 新增申报信息
	 *
	 * @param sql
	 */
	void addInfo(@Param(value = "sql") String sql);

	/**
	 * 修改申报信息
	 *
	 * @param sql
	 * @param id
	 */
	void modifyInfo(@Param(value = "sql") String sql, @Param(value = "id") String id);

	String selectPgIdById(@Param(value = "tableName") String tableName, @Param(value = "id") String id);

	void delInfo(@Param(value = "id") String id, @Param(value = "tableName") String tableName);

	/**
	 * 查询表字段规则
	 *
	 * @param ids
	 * @return
	 */
	List<Map<String, String>> selectColumnRuleList(@Param(value = "ids") List<String> ids);
}